gtkdnd: Don't bind/unbind keycodes that couldn't be determined
authorDaniel Drake <dsd@laptop.org>
Sun, 12 Jun 2011 16:48:17 +0000 (17:48 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 13 Jun 2011 01:44:00 +0000 (21:44 -0400)
commit794a3706cd29f8457731b09ac39870ee1d11bf94
tree4fcf08c9137abc33c226ff040fcce7d261d29ce5
parent36f6c6167b2599374343d1c6daab4b5765719a43
gtkdnd: Don't bind/unbind keycodes that couldn't be determined

At http://dev.laptop.org/ticket/10643 we are seeing that drag-and-drop
within the Sugar shell causes all of Sugar's custom keybindings to be
removed.

This is because gtkdnd tries to unbind XK_KP_Space, which (on my systems)
is resolved to NoSymbol by XKeycodeToKeysym(). NoSymbol has value 0,
the same as AnyKey, and XUngrabKey(AnyKey) is equivalent to unbinding
all possible keycodes.

Fix this by catching NoSymbol before binding/unbinding.

https://bugzilla.gnome.org/show_bug.cgi?id=652402
gtk/gtkdnd.c